package student.action;

import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
/**
 * 
 * @author Sai Naga Sravani Peraka
 */
public class Back extends ActionSupport{
	private String commandButton = "";
	public String getCommandButton() {
		return commandButton;
	}
	public void setCommandButton(String commandButton) {
		this.commandButton = commandButton;
	}
	public String execute() throws Exception {
		Map session = ActionContext.getContext().getSession();
		session = ActionContext.getContext().getSession();
		session.remove("table");
		if (this.commandButton.startsWith("Back to Admin")) {
			return "admin_home";
		}
		else if (this.commandButton.startsWith("Back to Admin")) {
			return "login";
		}
		else if (this.commandButton.startsWith("Back to Home")) {
			return "user_home";
		}
		else{
		/*Map session = ActionContext.getContext().getSession();
		session = ActionContext.getContext().getSession();
		session.remove("table");
		*/return "success";
		}
	}
}
